package service.impl;

import mapper.BlogMapper;
import mapper.CommentMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;
import pojo.Blog;
import pojo.Comment;
import service.BlogService;
import service.CommentService;

import javax.annotation.Resource;
import java.util.List;

@Service("commentService")
public class CommentServiceImpl implements CommentService {
    @Resource
    private CommentMapper commentMapper;

    @Override
    public List<Comment> getcommentbybeuserid(String userid) {
        return commentMapper.getcommentbybeuserid(userid);
    }
    @Override
    public int insertComment(Comment comment) {
        return commentMapper.insertComment(comment);
    }

    @Override
    public List<Comment> selectComment(@Param("blogId")String blogId) {
        return commentMapper.selectComment(blogId);
    }

    @Override
    public List<Comment> selectAllComment() {
        return commentMapper.selectAllComment();
    }

    @Override
    public int delete(int commentid) {
        return commentMapper.delete(commentid);
    }

}
